<%--
  Created by IntelliJ IDEA.
  User: fyf
  Date: 2018/11/8
  Time: 17:04
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<%@ include file="/common/taglib.jsp" %>
<%
    String path = request.getContextPath();
 /* String basePath = httpServletRequest.getScheme() + "://" + httpServletRequest.getServerName() + ":" +
      httpServletRequest.getServerPort() + "/" + httpServletRequest.getContextPath();*/
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() +
            "/" + request.getContextPath();
    request.setAttribute("basePath",basePath);

%>
<html>
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <meta charset="utf-8"/>
    <title>综合满意度调查项</title>
    <meta name="description" content="overview &amp; stats"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"/>
    <jsp:include page="/common/basecss.jsp" flush="true"/>
    <script src="${pageContext.request.contextPath}/js/jquery-2.1.0.js"></script>
    <script src="${pageContext.request.contextPath}/assets/js/layer-v3.1.0/layer/layer.js"></script>
</head>
<body>

<div class="main-container" id="main-container">
    <div class="main-content" id="page-wrapper">
        <div class="page-content" id="page-content">
            <div class="row">
                <div class="col-xs-12">
                    <div class="text-right">
                        <button type="button" class="btn btn-white btn-inverse btn-lg"
                                onclick="addSubItem()">添加调查细节</button>

                    </div>

                    <table class="table table-striped table-bordered table-hover center">
                        <tr>
                            <th colspan="9" class="center">
                                <h2>综合满意度调查项管理</h2>
                            </th>
                        </tr>

                        <tr>
                            <td rowspan="2"><h4>调查项</h4></td>
                            <td rowspan="2"><h4>调查细节</h4></td>
                            <td colspan="5"><h4>满意程度评分</h4></td>
                            <td rowspan="2"><h4>操作</h4></td>
                            <td rowspan="2"><h4>操作</h4></td>

                        </tr>
                        <tr>
                            <td>很满意</td>
                            <td>满意</td>
                            <td>一般</td>
                            <td>不满意</td>
                            <td>很不满意</td>
                        </tr>
                        <c:forEach items="${itemList}" var="bigItem">
                            <c:forEach items="${bigItem.subItemVOList}" var="subItem">
                                <tr>
                                    <td >
                                            ${bigItem.comment}
                                    </td>
                                    <td>
                                            ${subItem.itemName}
                                    </td>
                                    <c:forEach items="${subItem.selectValueVOList}" var="selectValue">
                                        <td >${selectValue.selectValue}</td>
                                    </c:forEach>
                                    <td>
                                        <button type="button" class="btn btn-white btn-inverse btn-sm"
                                                onclick="deleteSubItem('${subItem.id}','${subItem.itemName}');">删除</button>
                                    </td>
                                    <td>
                                        <button type="button" class="btn btn-white btn-inverse btn-sm"
                                                onclick="updateSubItem('${subItem.id}','${subItem.itemName}');">修改</button>
                                    </td>


                                </tr>
                            </c:forEach>
                        </c:forEach>


                    </table>
                </div>
            </div>
        </div>
    </div>
</div>


<%--删除--%>
<script>
    function deleteSubItem(sid,sname) {
        layer.confirm(
            "确认要删除调查项： "+sname+" 吗？",
            {
                btn:['是的','不，点错了']
            },
            function(){
                window.location.href='${pageContext.request.contextPath}/admin/deleteCompSubItem.go?id='+sid;
            }
            ,
            function(){
                layer.msg("好的",{icon: 6});
            }

        )
    }

</script>

<%--修改--%>
<script>
    function updateSubItem(sid) {
        layer.open({
            title: '修改综合满意调查项',
            type: 2,
            area: [
                '800px',
                '600px'],
            fix: false, //不固定
            maxmin: true,
            shadeClose:true,

            content:'${pageContext.request.contextPath}/admin/goUpdateSubItem.go?id='+sid+"&pageId=2"
        });
    }

</script>

<%--添加--%>
<script>
    function addSubItem() {
        layer.open({
            title: '添加综合满意度调查项',
            type: 2,
            area: [
                '800px',
                '600px'],
            fix: false, //不固定
            maxmin: true,
            shadeClose:true,

            content:'${pageContext.request.contextPath}/admin/goAddSubItem.go?pageId=2'
        });
    }

</script>


<jsp:include page="/common/basejs.jsp" flush="true"/>
</body>
</html>
